package com.ms.demo;

/**
 * @description: 创建一个实现了 Cloneable 接口的抽象类并重写clone()方法
 * @author: ms
 * @create: 2022-10-24 10:39
 */
public abstract class Shape implements Cloneable{

    private String id;
    public String type;

    abstract void draw();


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}